package org.sample.junit4.ex9;

import org.sample.junit4.Calculator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

public class OffsetCalculatorService {

    @Value("${calc.offset:0}")
    private int offset;

    @Autowired
    private Calculator calculator;

    public int addWithOffset(int a, int b) {
        return calculator.add(a, b) + offset;
    }

    public int getOffset() {
        return offset;
    }
}
